<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--  引入核心皮肤-->
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!--   引入核心js-->
    <script src="../../layui/layui.js"></script>
    <script>
        layui.use(['table'],function () {
            let table = layui.table;//定义表格组件
            table.render({
                elem: '#dg',
                url: '../../correct/allquestion',
                method:"get",
                parseData:function (res){
                    console.log(res)
                    return{
                        "code":0
                        ,"msg":""
                        ,"count":2
                        ,"data":res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    ,{field: 'questionid', title: '试卷ID'}
                    ,{field: 'questionname', title: '试卷名字'}
                    ,{field: 'startdate', title: '开始时间'}
                    ,{field: 'enddate', title: '结束时间'}
                    ,{field: 'right', title: '操作', toolbar: "#barDemo"}
                ]]
            })
        })
    </script>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail" href="lookstudent.html">查看</a>
    </script>
</head>
<body>
<table id="dg"></table>
</body>
</html>